import java.util.ArrayList;
import java.util.List;

/**
 * 解压缩列表
 *
 * @USER: Administrator
 * @DATE: 2024/9/23 下午11:18
 * @VERSION: 1.0.0
 */
public class LC1313 {
    public int[] decompressRLElist(int[] nums) {
        List<Integer> integers = new ArrayList<>();
        for (int i = 0; i < nums.length; i+=2) {
            for (int j = 0; j < nums[i]; j++) {
                integers.add(nums[i+1]);
            }
        }
        int[] res = new int[integers.size()];
        for (int i = 0; i < res.length; i++) {
            res[i] = integers.get(i);
        }

        return res;
    }
}
